//部落卫队
#include <iostream>
#include <vector>
using namespace std;
const int MAXN=100;
int n,m;
vector<int> enemys[MAXN+1];

int choise[MAXN+1];
int maxpeople=0;
int lastchoise[MAXN+1];
bool cannot[MAXN+1];
int answer[MAXN+1];

void search(int k,int next){
    bool cannotbackup[MAXN+1];
    if (k>n) return;
    for(int i=next;i<=n;i++){
        if (!cannot[i]){
            choise[k]=i;
            if (k>maxpeople){
                maxpeople=k;
                for(int x=1;x<=k;x++) lastchoise[x]=choise[x];
            }
            int s=enemys[i].size();
            for(int j=0;j<s;j++) {
                cannotbackup[enemys[i][j]]=cannot[enemys[i][j]];//备份i所有敌人的标记状态
                cannot[enemys[i][j]]=true;
            }
            search(k+1,i+1);
            for(int j=0;j<s;j++) {
                cannot[enemys[i][j]]=cannotbackup[enemys[i][j]];//恢复i所有敌人的标记状态
            }
        }
    }
}
int main(){
    cin>>n>>m;
    for(int k=1;k<=m;k++){
        int u,v;
        cin>>u>>v;
        enemys[u].push_back(v);
        enemys[v].push_back(u);
    }
    search(1,1);
    cout<<maxpeople<<endl;
    for(int i=1;i<=maxpeople;i++) answer[lastchoise[i]]=1;
    for(int i=1;i<=n;i++) cout<<answer[i]<<' ';

}